#include "WSObject.h"

WSObject::WSObject()
{
	mReference = 0;
	mManaged = false;
}

WSObject::~WSObject()
{

}

void WSObject::retain()
{
	assert(mReference > 0);

	++mReference;
}

void WSObject::release()
{
	assert(mReference > 0);

	--mReference;
	if (mReference == 0)
	{
		delete this;
	}
}

WSObject * WSObject::autorelease()
{
	mManaged = true;
	return this;
}